﻿@using AntUnion.FrameWork.Util;
@model AntUnion.FrameWork.Model.Models.CrmUser

@{
    ViewData["Title"] = "CRMAccountInfo";
    Layout = "~/Areas/Console/Views/Shared/_Layout.cshtml";
}
<style type="text/css">
    .layui-table-cell {
        text-align: center;
        height: auto;
        white-space: normal;
    }

    .layui-table img {
        max-width: 100px
    }
</style>
@section head{
    <script type="text/javascript">
        var renderTable;
        var renderWalletTable;
        var collectionAccountTable;
        var setSelectData;
        var userType = 0;
        var qrcode;
        var $;
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            treetable: 'treetable-lay/treetable',
            index: 'lib/index',
            qrcode: 'qrcode/qrcode'
        }).use(['table', 'treetable', 'index', 'laydate', 'form', 'qrcode', 'upload'], function () {
            $ = layui.$
                , form = layui.form
                , admin = layui.admin
                , table = layui.table
                , element = layui.element
                , laydate = layui.laydate
                , upload = layui.upload
                , qrcode = layui.qrcode;
            element.render();
            element.on('tab(component-tabs-brief)', function (obj) {
                userType = obj.index;
                if (userType === 5) {
                    collectionAccountTable();
                }
            });

            /**多语言初始化 */
            top.SetFormPageLanguage(layui);
            $('#programme').val("@ViewBag.SchemeId");
            $.getJSON("/Console/Roles/GetListJson?userType=1", function (result) {
                $('#roles').append(new Option(top.lang.none, ""));
                let plat = result.data;

                plat.forEach(function (v) {
                    for (var key in top.lang) {
                        if (top.lang.hasOwnProperty(key)) {
                            if (key === v.remark) {
                                var text = top.lang[key];
                                $('#roles').append(new Option(text, v.id));
                            }
                        }
                    }
                });
                if ($('#hiddenRoles').val() != "0") {
                    $('#roles').val($('#hiddenRoles').val());
                }
                layui.form.render("select");
            });

            /*账户信息 开始*/
            form.on('submit(accountEdit)', function (data) {
                $('#Name').removeAttr('disabled');
                $('#telephone').removeAttr('disabled');
                $('#email').removeAttr('disabled');
                $('#roles').attr("disabled", false);
                $('#state').attr("disabled", false);
                form.render();
                $('#accountEdit').addClass('layui-hide');
                $('#accountConfirmBtn').removeClass('layui-hide');
                $('#accountCancel').removeClass('layui-hide');
            });

            form.on('submit(accountCancel)', function (data) {
                $('#Name').prop('disabled', true);
                $('#telephone').prop('disabled', true);
                $('#email').prop('disabled', true);
                $('#roles').attr("disabled", true);
                $('#state').attr("disabled", true);
                form.render();
                $('#accountEdit').removeClass('layui-hide');
                $('#accountConfirmBtn').addClass('layui-hide');
                $('#accountCancel').addClass('layui-hide');
                location.reload();
            });

            var state = "@Model.State";
            form.on('switch(state)', function (data) {
                if (this.checked) {
                    state = 1;
                } else {
                    state = 0;
                }
            });

            form.on('submit(accountConfirmBtn)', function (data) {
                $.ajax({
                    type: "POST",
                    url: "/Console/CRMAccount/EditCRMAccountInfo",
                    data: {
                        "Id": $('#Id').val(),
                        "Name": $('#Name').val(),
                        "Telephone": $('#telephone').val(),
                        "Email": $('#email').val(),
                        "userRoles": $("#roles option:selected").val(),
                        "State": state
                    },
                    async: true,
                    error: function (request) {
                        alert("Connection error");
                    },
                    beforeSend: function (xhr) {
                        layui.layer.load();
                    },
                    success: function (data) {
                        var item = eval(data);
                        if (item.code == 0) {
                            /**提示语弹框 */
                            top.ShowMessageByKey(layui, "submitSuccess", 6, 1000, function () {
                                parent.layer.close(parentFrameIndex);
                                parent.renderTable();
                            });
                            $('#Name').prop('disabled', true);
                            $('#telephone').prop('disabled', true);
                            $('#email').prop('disabled', true);
                            $('#roles').attr("disabled", true);
                            $('#state').attr("disabled", true);
                            form.render();
                            $('#accountEdit').removeClass('layui-hide');
                            $('#accountConfirmBtn').addClass('layui-hide');
                            $('#accountCancel').addClass('layui-hide');
                        } else {
                            /**提示语弹框 */
                            top.AlertByKey(layui, "submitFail", 0);
                        }
                        layer.closeAll('loading');
                    }
                });
                return false;
            });
            /*账户信息 结束*/

            /*个人信息 开始*/
            var countryLanguage = "country-zh-CN.json";
            switch (top.thisLanguages) {
                case "manage-zh-CN":
                case "user-zh-CN":
                    countryLanguage = "country-zh-CN.json";
                    break;
                case "manage-en-US":
                case "user-en-US":
                    countryLanguage = "country-en-US.json";
                    break;
            }
            $.getJSON("/language/" + countryLanguage, function (result) {
                $('#countryRegion').append(new Option(top.lang.pleaseSelect, ""));
                $.each(result, function (key) {
                    $('#countryRegion').append(new Option(result[key], key));
                });
                if ($("#HideCountryRegion").val() != "") {
                    $('#countryRegion').val($("#HideCountryRegion").val());
                }
                layui.form.render("select");
            });

            $('#gender').append(new Option(top.lang.pleaseSelect, ""));
            $('#gender').append(new Option(top.lang.male, "male"));
            $('#gender').append(new Option(top.lang.female, "female"));
            $('#gender').append(new Option(top.lang.secrecy, "secrecy"));
            if ($("#HideGender").val() != "") {
                $('#gender').val($("#HideGender").val());
            }
            layui.form.render("select");

                $('#idtype').append(new Option(top.lang.pleaseSelect, ""));
            $('#idtype').append(new Option(top.lang.male, "male"));
            if ($("#HideGender").val() != "") {
                $('#gender').val($("#HideGender").val());
            }
            layui.form.render("select");

            $('#idType').append(new Option(top.lang.pleaseSelect, ""));
            $('#idType').append(new Option(top.lang.passport, "passport"));
            $('#idType').append(new Option(top.lang.IDcard, "IDcard"));
            if ($("#HideIDType").val() != "") {
                $('#idType').val($("#HideIDType").val());
            }
            layui.form.render("select");

            //日期范围
            laydate.render({
                elem: '#birthday'
            });

            $('#personalInformation *').addClass('layui-disabled').prop('disabled', true);
            $('#financialInformation *').addClass('layui-disabled').prop('disabled', true);

            form.on('submit(personalInfoEdit)', function (data) {
                $('#personalInfoEdit').addClass('layui-hide');
                $('#personalInfoConfirmBtn').removeClass('layui-hide');
                $('#personalInfoCancel').removeClass('layui-hide');
                $('#personalInformation *').removeClass('layui-disabled').prop('disabled', false);
                layui.form.render("select");
            });

            form.on('submit(personalInfoCancel)', function (data) {
                $('#personalInfoEdit').removeClass('layui-hide');
                $('#personalInfoConfirmBtn').addClass('layui-hide');
                $('#personalInfoCancel').addClass('layui-hide');
                $('#personalInformation *').addClass('layui-disabled').prop('disabled', true);
                layui.form.render("select");
                location.reload();
            });

            form.on('submit(personalInfoConfirmBtn)', function (data) {
                var inputModels = [];
                var inputsAndSelects = $('.personalInformation .personInput');
                inputsAndSelects.each(function () {
                    if ($(this).attr("name") == "HideCountryRegion" || $(this).attr("name") == "HideGender") {
                        return;
                    }
                    if ($(this).attr("name") !== null && $(this).attr("name") !== "") {
                        var inputModel = {
                            "type": $(this)[0].tagName,
                        };

                        switch ($(this)[0].tagName) {
                            case "INPUT":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $(this).val();
                                break;
                            case "SELECT":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $("#" + $(this).attr("name")).val();
                                break;
                            case "IMG":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $("#" + $(this).attr("id")).attr('src');
                                break;
                            case "LABEL":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $('input[name="' + $(this).attr("id") + '"]:checked').val();
                                break;
                        }
                        inputModels.push(inputModel);
                    }
                });

                $.ajax({
                    type: "POST",
                    url: "/Console/CRMAccount/EditCRMInfo",
                    data: {
                        "id": $('#Id').val(),
                        "type": 1,
                        "loginName": $('#accountID').val(),
                        "inputModels": inputModels
                    },
                    async: true,
                    error: function (request) {
                        alert("Connection error");
                    },
                    beforeSend: function (xhr) {
                        layui.layer.load();
                    },
                    success: function (data) {
                        var item = eval(data);
                        if (item.code == 0) {
                            /**提示语弹框 */
                            top.ShowMessageByKey(layui, "submitSuccess", 6, 1000, function () {
                                parent.renderTable();
                            });
                            $("#personalInformation input").each(function () {
                                $(this).prop('disabled', true);
                            });
                            $('#personalInfoEdit').removeClass('layui-hide');
                            $('#personalInfoConfirmBtn').addClass('layui-hide');
                            $('#personalInfoCancel').addClass('layui-hide');
                        } else {
                            /**提示语弹框 */
                            top.AlertByKey(layui, "submitFail", 0);
                        }
                        layer.closeAll('loading');
                    }
                });
                return false;
            });
            /*个人信息 结束*/

            /*财务信息 开始*/
            form.on('submit(financialInfoEdit)', function (data) {
                $('#financialInfoEdit').addClass('layui-hide');
                $('#financialInfoConfirmBtn').removeClass('layui-hide');
                $('#financialInfoCancel').removeClass('layui-hide');
                $('#financialInformation *').removeClass('layui-disabled').prop('disabled', false);
                layui.form.render("select");
            });

            form.on('submit(financialInfoCancel)', function (data) {
                $('#financialInfoEdit').removeClass('layui-hide');
                $('#financialInfoConfirmBtn').addClass('layui-hide');
                $('#financialInfoCancel').addClass('layui-hide');
                $('#financialInformation *').addClass('layui-disabled').prop('disabled', true);
                layui.form.render("select");
                location.reload();
            });

            form.on('submit(financialInfoConfirmBtn)', function (data) {
                var inputModels = [];
                var inputsAndSelects = $('.financialInformation .personInput');
                inputsAndSelects.each(function () {
                    if ($(this).attr("name") == "HideCountryRegion" || $(this).attr("name") == "HideGender") {
                        return;
                    }
                    if ($(this).attr("name") !== null && $(this).attr("name") !== "") {
                        var inputModel = {
                            "type": $(this)[0].tagName,
                        };
                        switch ($(this)[0].tagName) {
                            case "INPUT":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $(this).val();
                                break;
                            case "SELECT":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $("#" + $(this).attr("name")).val();
                                break;
                            case "IMG":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $("#" + $(this).attr("id")).attr('src');
                                break;
                            case "LABEL":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $('input[name="' + $(this).attr("id") + '"]:checked').val();
                                break;
                        }
                        inputModels.push(inputModel);
                    }
                });
                $.ajax({
                    type: "POST",
                    url: "/Console/CRMAccount/EditCRMInfo",
                    data: {
                        "id": $('#Id').val(),
                        "type": 2,
                        "loginName": $('#accountID').val(),
                        "inputModels": inputModels
                    },
                    async: true,
                    error: function (request) {
                        alert("Connection error");
                    },
                    beforeSend: function (xhr) {
                        layui.layer.load();
                    },
                    success: function (data) {
                        var item = eval(data);
                        if (item.code == 0) {
                            /**提示语弹框 */
                            top.ShowMessageByKey(layui, "submitSuccess", 6, 1000, function () {
                                parent.renderTable();
                            });
                            $("#financialInformation input").each(function () {
                                $(this).prop('disabled', true);
                            });
                            $('#financialInfoEdit').removeClass('layui-hide');
                            $('#financialInfoConfirmBtn').addClass('layui-hide');
                            $('#financialInfoCancel').addClass('layui-hide');
                        } else {
                            /**提示语弹框 */
                            top.AlertByKey(layui, "submitFail", 0);
                        }
                        layer.closeAll('loading');
                    }
                });
                return false;
            });
            /*财务信息 结束*/

            /*身份信息 开始*/
            form.on('submit(identityInfoEdit)', function (data) {
                $("#identityInformation input").each(function () {
                    $(this).removeAttr('disabled');
                });
                $('#identityInfoEdit').addClass('layui-hide');
                $('#identityInfoConfirmBtn').removeClass('layui-hide');
                $('#identityInfoCancel').removeClass('layui-hide');
            });

            form.on('submit(identityInfoCancel)', function (data) {
                $("#identityInformation input").each(function () {
                    $(this).prop('disabled', true);
                });
                $('#identityInfoEdit').removeClass('layui-hide');
                $('#identityInfoConfirmBtn').addClass('layui-hide');
                $('#identityInfoCancel').addClass('layui-hide');
                location.reload();
            });

            form.on('submit(identityInfoConfirmBtn)', function (data) {
                var inputModels = [];
                $("#identityInformation input").each(function () {
                    var inputModel = {
                        "name": $(this).attr("name"),
                        "type": $(this).attr("type"),
                        "value": $(this).val()
                    };
                    inputModels.push(inputModel);
                });
                $.ajax({
                    type: "POST",
                    url: "/Console/CRMAccount/EditCRMInfo",
                    data: {
                        "id": $('#Id').val(),
                        "type": 2,
                        "loginName": $('#accountID').val(),
                        "inputModels": inputModels
                    },
                    async: true,
                    error: function (request) {
                        alert("Connection error");
                    },
                    beforeSend: function (xhr) {
                        layui.layer.load();
                    },
                    success: function (data) {
                        var item = eval(data);
                        if (item.code == 0) {
                            /**提示语弹框 */
                            top.ShowMessageByKey(layui, "submitSuccess", 6, 1000, function () {
                                parent.renderTable();
                            });
                            $("#identityInformation input").each(function () {
                                $(this).prop('disabled', true);
                            });
                            $('#identityInfoEdit').removeClass('layui-hide');
                            $('#identityInfoConfirmBtn').addClass('layui-hide');
                            $('#identityInfoCancel').addClass('layui-hide');
                        } else {
                            /**提示语弹框 */
                            top.AlertByKey(layui, "submitFail", 0);
                        }
                        layer.closeAll('loading');
                    }
                });
                return false;
            });
            /*身份信息 结束*/


            /*交易账号 开始 */
            //MT5用户列表
            renderTable = function () {
                table.render({
                    elem: '#table-datalist-mt5user'
                    , url: '/Console/MT5Users/GetListJson'
                    , toolbar: false
                    , limit: 20
                    , title: '数据表'
                    , where: {
                        crmId: $("#Id").val()
                    }
                    , cols: [[
                        { field: 'index', title: '序号', type: 'numbers', width: 60, templet: '#zizeng' }
                        , {
                            field: 'fullNameAndId', title: '姓名/账户ID', templet: function (res) {
                                return res.fullName;
                            }
                        }
                        , {
                            field: 'tradingAccountNo', title: '交易账号', templet: function (res) {
                                if (res.accountType == 0)
                                    return res.tradingAccount;
                                else
                                    return res.tradingAccount;
                            }
                        }
                        , { field: 'server', title: '服务器' }
                        , {
                            field: 'MTgroups', title: '组别', templet: function (res) {
                                return res.groups;
                            }
                        }
                        , { field: 'laverage', title: '杠杆', width: 80 }
                        , {
                            field: 'MT5balance', title: 'MT5余额', templet: function (res) {
                                return res.balance;
                            }
                        }
                        , { field: 'operate', fixed: 'right', title: '操作', toolbar: '#table-datalist-bar-mt5user', width: 80 }
                    ]]
                    , page: { layout: ['prev', 'page', 'next', 'refresh'] }
                    , done: function (res) {
                        if (res.count == 0) {
                            $(".layui-table-main").html('<div class="layui-none">' + top.lang.noData + '</div>');
                        }
                        layer.closeAll('loading');
                        /**多语言初始化 */
                        top.SetListPageLanguage(layui);
                    }
                });
            };
            renderTable();
            //监听行工具事件
            table.on('tool(table-datalist-mt5user)', function (obj) {
                var data = obj.data;
                if (obj.event === 'view') {
                    parent.layui.index.openTabsPage("/Console/MT5Users/MT5AccountInfo?id=" + data.tradingAccount, data.tradingAccount);
                    //初始化导航选项卡（选中新建标签卡）
                    parent.layui.element.render('nav');
                }
            });
            /*交易账号 结束 */

            /*钱包账户 开始 */
            renderWalletTable = function () {
                table.render({
                    elem: '#table-datalist-crmWallet'
                    , url: '/Console/CRMWallet/GetListJson'
                    , toolbar: false
                    , defaultToolbar: false
                    , limit: 20
                    , title: '数据表'
                    , where: {
                        crmId: $("#Id").val()
                    }
                    , cols: [[
                        { field: 'index', title: '序号', type: 'numbers', width: 60, templet: '#crmWalletIndex' }
                        , {
                            field: 'fullNameAndId', title: '姓名/账户ID', templet: function (res) {
                                return res.fullName;
                            }
                        }
                        , { field: 'currency', title: '币种' }
                        , { field: 'balance', title: '余额' }
                        , { field: 'totalDeposit', title: '总入金' }
                        , {
                            field: 'totalWithdrawal', title: '总出金', templet: function (res) {
                                if (Number(res.totalWithdrawal) > 0) {
                                    return "- " + res.totalWithdrawal;
                                } else {
                                    return res.totalWithdrawal;
                                }
                            }
                        }
                        , { field: 'operate', fixed: 'right', title: '操作', toolbar: '#table-datalist-bar-crmWallet', width: 80 }
                    ]]
                    , page: { layout: ['prev', 'page', 'next', 'refresh'] }
                    , done: function (res) {
                        if (res.count == 0) {
                            $(".layui-table-main").html('<div class="layui-none">' + top.lang.noData + '</div>');
                        }
                        layer.closeAll('loading');
                        /**多语言初始化 */
                        top.SetListPageLanguage(layui);
                    }
                });
            };
            renderWalletTable();
            //监听行工具事件
            table.on('tool(table-datalist-crmWallet)', function (obj) {
                var data = obj.data;
                if (obj.event === 'view') {
                    parent.layui.index.openTabsPage("/Console/CRMWalletTransactions/Index?walletId=" + data.id, top.lang.capitalFlow + '(' + data.fullName + ')');
                    //初始化导航选项卡（选中新建标签卡）
                    parent.layui.element.render('nav');
                }
            });
            /*钱包账户 结束 */

            /*收款账户 开始 */
            form.on('submit(bankAccount)', function (data) {
                table.render({
                    elem: '#table-datalist-collectionAccount'
                    , url: '/Console/RemittanceAccount/GetListJson'
                    , toolbar: false
                    , defaultToolbar: false
                    , limit: 20
                    , title: '数据表'
                    , where: {
                        crmId: $("#Id").val()
                    }
                    , cols: [[
                        { field: 'index', title: '序号', type: 'numbers', width: 60, templet: '#collectionAccountIndex' }
                        , {
                            field: 'remittingBank', title: '汇款银行', templet: function (res) {
                                return res.bank;
                            }
                        }
                        , {
                            field: 'bankAccountName', title: '银行户名', templet: function (res) {
                                return res.accountName;
                            }
                        }
                        , {
                            field: 'bankAccountNo', title: '银行账号', templet: function (res) {
                                return res.accountNumber;
                            }
                        }
                        , { field: 'branchName', title: '支行名称' }
                        , {
                            title: '收款二维码', field: 'qrcode', align: 'center', width: 130,
                            templet: function dataUrl(d) {
                                var img = "<img src='" + d.qrcode + "' onclick='imgcli(this)'>";
                                return img;
                            }
                        }
                    ]]
                    , page: { layout: ['prev', 'page', 'next', 'refresh'] }
                    , done: function (res) {
                        if (res.count == 0) {
                            $(".layui-table-main").html('<div class="layui-none">' + top.lang.noData + '</div>');
                        }
                        layer.closeAll('loading');
                        /**多语言初始化 */
                        top.SetListPageLanguage(layui);
                    }
                });
            });

            form.on('switch(table-img)', function (obj) {
                previewImg($(this).attr("src"))
            });

            form.on('submit(electronicAccount)', function (data) {
                collectionAccountTable();
            });
            collectionAccountTable = function () {
                table.render({
                    elem: '#table-datalist-collectionAccount'
                    , url: '/Console/CRMWireTransfer/GetListJson'
                    , toolbar: false
                    , defaultToolbar: false
                    , limit: 20
                    , title: '数据表'
                    , where: {
                        crmId: $("#Id").val()
                    }
                    , cols: [[
                        { field: 'index', title: '序号', type: 'numbers', width: 60, templet: '#collectionAccountIndex' }
                        , {
                            field: 'bankAccountName', title: '银行户名', templet: function (res) {
                                return res.payee;
                            }
                        }
                        , {
                            field: 'remittingBank', title: '汇款银行', templet: function (res) {
                                return res.bank;
                            }
                        }
                        , {
                            field: 'bankAccountNo', title: '银行账号', templet: function (res) {
                                return res.payeeNumber;
                            }
                        }
                        , {
                            field: 'federalClearingNumber', title: '联邦清算号', templet: function (res) {
                                return res.payeeAddress;
                            }
                        }
                        , { field: 'swiftcode', title: 'SWIFT' }
                        //, { field: 'currencyReceipt', title: '收款货币' }
                        , { field: 'bankAddress', title: '汇款银行地址' }
                    ]]
                    , page: { layout: ['prev', 'page', 'next', 'refresh'] }
                    , done: function (res) {
                        if (res.count == 0) {
                            $(".layui-table-main").html('<div class="layui-none">' + top.lang.noData + '</div>');
                        }
                        layer.closeAll('loading');
                        /**多语言初始化 */
                        top.SetListPageLanguage(layui);
                    }
                });
            };

            form.on('submit(cryptocurrency)', function (data) {
                table.render({
                    elem: '#table-datalist-collectionAccount'
                    , url: '/Console/CRMCryptocurrency/GetListJson'
                    , toolbar: false
                    , defaultToolbar: false
                    , limit: 20
                    , title: '数据表'
                    , where: {
                        crmId: $("#Id").val()
                    }
                    , cols: [[
                        { field: 'index', title: '序号', type: 'numbers', width: 60, templet: '#collectionAccountIndex' }
                        , {
                            field: 'currencyType', title: '币种类型', templet: function (res) {
                                return res.currencyReceipt;
                            }
                        }
                        , {
                            field: 'network', title: '区块链网络', templet: function (res) {
                                return res.network;
                            }
                        }
                        , {
                            field: 'cryptocurrencyAddress', title: '加密货币地址', templet: function (res) {
                                return res.payeeAddress;
                            }
                        }
                        , {
                            title: '二维码地址', field: 'qrcodeAddress', align: 'center',
                            templet: function dataUrl(d) {
                                var img = "<div id='div" + d.id + "'></div>";
                                return img;
                            }
                        }
                    ]]
                    , page: { layout: ['prev', 'page', 'next', 'refresh'] }
                    , done: function (res) {
                        if (res.count == 0) {
                            $(".layui-table-main").html('<div class="layui-none">' + top.lang.noData + '</div>');
                        }
                        layer.closeAll('loading');
                        /**多语言初始化 */
                        top.SetListPageLanguage(layui);
                        res.data.forEach(function (item) {
                            $('#div' + item.id).qrcode({
                                render: "canvas", //也可以替换为table
                                width: 100,
                                height: 100,
                                text: item.payeeAddress
                            });
                            $('#div' + item.id).click(function () {
                                divShow(item.payeeAddress);
                            });
                        });
                    }
                });
            });


            table.on('toolbar(test-table-toolbar)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'getCheckData':
                        var data = checkStatus.data;
                        layer.alert(JSON.stringify(data));
                        break;
                    case 'getCheckLength':
                        var data = checkStatus.data;
                        layer.msg('选中了：' + data.length + ' 个');
                        break;
                    case 'isAll':
                        layer.msg(checkStatus.isAll ? '全选' : '未全选');
                        break;
                };
            });
            /*收款账户 结束 */

            /*返佣方案 开始*/

            $('#returningRole').append(new Option(top.lang.pleaseSelect, ""));
            $('#returningRole').append(new Option(top.lang.promoter, "1"));
            $('#returningRole').append(new Option(top.lang.ordinaryUsers, "0"));
            if ("@Model.Role" != "") {
                $('#returningRole').val("@Model.Role");
            }
            layui.form.render("select");

            $.getJSON("/Console/RebateScheme/GetListJson?page=0&limit=0", function (result) {
                let plat = result.data;
                $('#programme').append(new Option(top.lang.pleaseSelect, ""));
                plat.forEach(function (v) {
                    $('#programme').append(new Option(v.names, v.id));
                });
                if ("@Model.SchemeId" != "0") {
                    $('#programme').val("@Model.SchemeId");
                }
                layui.form.render("select");
            });

            form.on('submit(programmeEdit)', function (data) {
                $('#programme').attr("disabled", false);
                $('#returningRole').attr("disabled", false);
                form.render();
                $('#programmeEdit').addClass('layui-hide');
                $('#programmeConfirmBtn').removeClass('layui-hide');
                $('#programmeCancel').removeClass('layui-hide');
            });

            form.on('submit(programmeCancel)', function (data) {
                $('#programme').attr("disabled", true);
                $('#returningRole').attr("disabled", true);
                form.render();
                $('#programmeEdit').removeClass('layui-hide');
                $('#programmeConfirmBtn').addClass('layui-hide');
                $('#programmeCancel').addClass('layui-hide');
                location.reload();
            });

            form.on('submit(programmeConfirmBtn)', function (data) {
                if ($('#returningRole').val() === "") {
                    top.AlertByKey(layui, "pleaseSelectReturningRole", 0);
                    return false;
                }
                if ($('#returningRole').val() === "1" && $('#programme').val() === "") {
                    top.AlertByKey(layui, "pleaseSelectProgramme", 0);
                    return false;
                }
                //if ($('#programme').val() === "") {
                //    top.AlertByKey(layui, "pleaseSelectProgramme", 0);
                //    return false;
                //}
                $.ajax({
                    type: "POST",
                    url: "/Console/CRMAccount/EditProgramme",
                    data: {
                        "id": $('#Id').val(),
                        "returningRole": $('#returningRole').val(),
                        "programme": $('#programme').val()
                    },
                    async: true,
                    error: function (request) {
                        alert("Connection error");
                    },
                    beforeSend: function (xhr) {
                        layui.layer.load();
                    },
                    success: function (data) {
                        var item = eval(data);
                        if (item.code == 0) {
                            top.ShowMessageByKey(layui, "updateSuccess", 6, 1000);
                            /**提示语弹框 */
                            $('#returningRole').attr("disabled", true);
                            $('#programme').attr("disabled", true);
                            form.render();
                            $('#programmeEdit').removeClass('layui-hide');
                            $('#programmeConfirmBtn').addClass('layui-hide');
                            $('#programmeCancel').addClass('layui-hide');                            
                        } else {
                            /**提示语弹框 */
                            top.AlertByKey(layui, "submitFail", 0);
                        }
                        layer.closeAll('loading');
                    }
                });
                return false;
            });
            /*返佣方案 结束*/

            $(".uploadView").each(function () {
                var id = $(this).attr("id")
                //上传
                upload.render({
                    elem: '#' + id + "Upload"
                    , url: '/Base/UploadFile'
                    , accept: 'images'
                    , exts: 'jpg|png'
                    , done: function (res, index, upload) {
                        $('#' + id + "View").removeClass('layui-hide').find('img').attr('src', res.data.src);
                    }
                });
                //删除图片
                $('#' + id + 'Remove').click(function (res) {
                    $('#' + id + "View").val('').find('img').attr('src', '');
                });
            });

            //图片预览事件
            $('.uploadShowView img').click(function (e) {
                previewImg(this);
                e.stopPropagation()
            });
        });

        function imgcli(obj) {
            var src = $(obj).attr("src");
            var imgHtml = "<div style='overflow:auto;display:flex;align-items:center;width:700px;height:700px;justify-content:center;'>"
                + "<img style='width:auto;height:auto;text-align:center;' src='" + src + "' /></div>";
            //弹出层
            layer.open({
                type: 1,
                shade: true,
                shade: [0.4, '#000000'],
                title: false, //不显示标题
                area: ['auto', 'auto'],
                content: imgHtml, //捕获的元素，注意：最好该指定的元素要存放在body最外层，否则可能被其它的相对元素所影响
                cancel: function () {

                }
            });
        }
        function divShow(receivingAddress) {
            $('#showqrcode').qrcode({
                render: "canvas", //也可以替换为table
                width: 500,
                height: 500,
                text: receivingAddress
            });
            //弹出层
            layer.open({
                type: 1,
                shade: true,
                shade: [0.4, '#000000'],
                title: false, //不显示标题
                area: ['700px', '700px'],
                content: $("#divShowQrcode"),
                cancel: function () {
                    $("#showqrcode").html("");
                }
            });
        }
    </script>
}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-tab layui-tab-brief" lay-filter="component-tabs-brief">
                        <ul class="layui-tab-title">
                            <li lay-event="accountInformation" class="layui-this">账户信息</li>
                            <li lay-event="personalInformation">个人信息</li>
                            <li lay-event="financialInformation">财务信息</li>
                            @*<li lay-event="identityInformation">身份信息</li>*@
                            <li lay-event="tradingAccount">交易账户</li>
                            <li lay-event="walletAccount">钱包账户</li>
                            <li lay-event="collectionAccount">收款账户</li>
                            <li lay-event="rebateSettings">返佣设置</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                <div class="layui-row layui-col-space10">
                                    <div class="layui-form">
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label"><cite style="color:red">&nbsp;&nbsp;*&nbsp;&nbsp;</cite><span lay-event="fullName">姓</span></label>
                                                <div class="layui-input-inline">
                                                    <input type="text" id="Name" name="Name" placeholder="fullName" value="@Model.Name" class="layui-input" disabled>
                                                    @Html.HiddenFor(m => m.Id)
                                                    <input id="hiddenRoles" type="hidden" value="@ViewBag.userRoles" />
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" lay-event="role">角色</label>
                                                <div class="layui-input-inline">
                                                    <select name="roles" id="roles" disabled>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" lay-event="userSource">客户来源</label>
                                                <div class="layui-input-inline">
                                                    @if (Model.Source == 0)
                                                    {
                                                        <input type="text" class="layui-input" id="userSource" name="userSource" layui-value="frontEndCreation" disabled>
                                                    }
                                                    else
                                                    {
                                                        <input type="text" class="layui-input" id="userSource" name="userSource" layui-value="backgroundCreation" disabled>
                                                    }
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            @if (Model.CrmUp == null)
                                            {
                                                <div class="layui-inline">
                                                    <label class="layui-form-label" lay-event="crmUp">上级</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" id="crmUp" name="crmUp" class="layui-input" disabled>
                                                    </div>
                                                </div>
                                                <div class="layui-inline">
                                                    <label class="layui-form-label" lay-event="inviterEmail">上级邮箱</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" id="inviterEmail" name="inviterEmail" class="layui-input" disabled>
                                                    </div>
                                                </div>
                                            }
                                            else
                                            {
                                                AntUnion.FrameWork.Model.Models.mtContext _context = new AntUnion.FrameWork.Model.Models.mtContext();
                                                AntUnion.FrameWork.Model.Models.CrmUser crmUser = _context.CrmUsers.FirstOrDefault(k => k.Id == Model.CrmUp);
                                                if (crmUser != null)
                                                {
                                                    <div class="layui-inline">
                                                        <label class="layui-form-label" lay-event="crmUp">上级</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" id="crmUp" name="crmUp" value="@crmUser.Name" class="layui-input" disabled>
                                                        </div>
                                                    </div>
                                                    <div class="layui-inline">
                                                        <label class="layui-form-label" lay-event="inviterEmail">上级邮箱</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" id="inviterEmail" name="inviterEmail" value="@crmUser.Email" class="layui-input" disabled>
                                                        </div>
                                                    </div>
                                                }
                                                else
                                                {
                                                    <div class="layui-inline">
                                                        <label class="layui-form-label" lay-event="crmUp">上级</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" id="crmUp" name="crmUp" class="layui-input" disabled>
                                                        </div>
                                                    </div>
                                                    <div class="layui-inline">
                                                        <label class="layui-form-label" lay-event="inviterEmail">上级邮箱</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" id="inviterEmail" name="inviterEmail" class="layui-input" disabled>
                                                        </div>
                                                    </div>
                                                }
                                            }
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" lay-event="telephone">手机号</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" id="telephone" name="telephone" value="@Model.Telephone" class="layui-input" disabled>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" lay-event="accountID">账户ID</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" id="accountID" name="accountID" value="@Model.LoginName" class="layui-input" disabled>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" lay-event="registrationTime">注册时间</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" id="registrationTime" name="registrationTime" value="@Model.CreateDate" class="layui-input" disabled>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label"><cite style="color:red">&nbsp;&nbsp;*&nbsp;&nbsp;</cite><span lay-event="email">邮箱</span></label>
                                                <div class="layui-input-inline">
                                                    <input type="text" id="email" name="email" value="@Model.Email" class="layui-input" disabled>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" lay-event="state">状态</label>
                                                <div class="layui-input-inline">
                                                    @if (Model.State == 0)
                                                    {
                                                        @*<input type="checkbox" name="close" lay-skin="switch" lay-text="ON|OFF">*@
                                                        <input type="checkbox" id="state" name="state" lay-skin="switch" lay-filter="state" disabled>
                                                    }
                                                    else
                                                    {
                                                        <input type="checkbox" id="state" name="state" lay-skin="switch" lay-filter="state" checked="checked" disabled>
                                                    }
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" lay-event="recentlyLogin">最近登录</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" id="recentlyLogin" name="recentlyLogin" value="@Model.LastTime" class="layui-input" disabled>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-input-block">
                                        <button class="layui-btn" id="accountEdit" lay-event="edit" lay-submit lay-filter="accountEdit">编辑</button>
                                        <button class="layui-btn layui-hide" id="accountConfirmBtn" lay-event="confirmBtn" lay-submit lay-filter="accountConfirmBtn">确认</button>
                                        <button class="layui-btn layui-btn-primary layui-hide" id="accountCancel" lay-event="cancel" lay-submit lay-filter="accountCancel">取消</button>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-tab-item">
                                <div class="layui-form">
                                    <div id="personalInformation" class="layui-row layui-col-space10 layui-form-item personalInformation">
                                        @if (ViewBag.personalInformations != null)
                                        {
                                            List<AntUnion.FrameWork.Model.Models.CrmKyc> personalInformations = ViewBag.personalInformations as List<AntUnion.FrameWork.Model.Models.CrmKyc>;
                                            if (personalInformations != null && personalInformations.Count > 0)
                                            {
                                                foreach (AntUnion.FrameWork.Model.Models.CrmKyc crmKyc in personalInformations)
                                                {
                                                    if (crmKyc.Name == "countryRegion" && crmKyc.Type == "select")
                                                    {
                                                        <div class="layui-col-lg6">
                                                            <label class="layui-form-label" lay-event="@crmKyc.Name"></label>
                                                            @if (crmKyc.Required == 0)
                                                            {
                                                                <span class="required">*</span>
                                                            }
                                                            <div class="layui-input-block">
                                                                <select name="@crmKyc.Name" id="@crmKyc.ControlId" lay-search="" class="personInput">
                                                                </select>
                                                                <input id="HideCountryRegion" name="HideCountryRegion" type="hidden" value="@crmKyc.Value" />
                                                            </div>
                                                        </div>
                                                    }
                                                    else if (crmKyc.Name == "gender" && crmKyc.Type == "select")
                                                    {
                                                        <div class="layui-col-lg6">
                                                            <label class="layui-form-label" lay-event="@crmKyc.Name"></label>
                                                            @if (crmKyc.Required == 0)
                                                            {
                                                                <span class="required">*</span>
                                                            }
                                                            <div class="layui-input-block">
                                                                <select name="@crmKyc.Name" id="@crmKyc.ControlId" lay-search="" class="personInput">
                                                                </select>
                                                                <input id="HideGender" name="HideGender" type="hidden" value="@crmKyc.Value" />
                                                            </div>
                                                        </div>
                                                    }
                                                    else if (crmKyc.Name == "idType" && crmKyc.Type == "select")
                                                    {
                                                        <div class="layui-col-lg6">
                                                            <label class="layui-form-label" lay-event="@crmKyc.Name"></label>
                                                            @if (crmKyc.Required == 0)
                                                            {
                                                                <span class="required">*</span>
                                                            }
                                                            <div class="layui-input-block">
                                                                <select name="@crmKyc.Name" id="@crmKyc.ControlId" lay-search="" class="personInput">
                                                                </select>
                                                                <input id="HideIDType" name="HideIDType" type="hidden" value="@crmKyc.Value" />
                                                            </div>
                                                        </div>
                                                    }
                                                    else if (crmKyc.Type == "text")
                                                    {
                                                        <div class="layui-col-lg6">
                                                            <label class="layui-form-label" lay-event="@crmKyc.Name"></label>
                                                            @if (crmKyc.Required == 0)
                                                            {
                                                                <span class="required">*</span>
                                                            }
                                                            <div class="layui-input-block">
                                                                <input type="@crmKyc.Type" id="@crmKyc.ControlId" name="@crmKyc.Name" placeholder="@crmKyc.Name" value="@crmKyc.Value" class="layui-input personInput">
                                                            </div>
                                                        </div>
                                                    }
                                                    else if (crmKyc.Type == "radio")
                                                    {
                                                        @if (!string.IsNullOrEmpty(crmKyc.Config))
                                                        {
                                                            <div class="layui-col-xs12">
                                                                <label class="layui-input-block personInput" style="margin-left: 50px;" lay-event="@crmKyc.Name" id="@crmKyc.ControlId">@crmKyc.Name</label>
                                                                @if (crmKyc.Required == 0)
                                                                {
                                                                    <span style="color:red;">*</span>
                                                                }
                                                                <div class="layui-input-block">
                                                                    @foreach (AntUnion.FrameWork.Model.Models.CrmKycConfig config in JsonUtil.DeserializeJsonToList<AntUnion.FrameWork.Model.Models.CrmKycConfig>(crmKyc.Config))
                                                                    {
                                                                        <input type="radio" name="@config.name" value="@config.value" title="@config.title" @(crmKyc.Value == config.value ? "checked" : "")>
                                                                    }
                                                                </div>
                                                            </div>
                                                        }
                                                    }
                                                    else if (crmKyc.Type == "image")
                                                    {
                                                        <div class="layui-col-lg6">
                                                            <label class="layui-form-label" lay-event="@crmKyc.ControlId">@crmKyc.Name</label>
                                                            @if (crmKyc.Required == 0)
                                                            {
                                                                <span class="required">*</span>
                                                            }
                                                            <div class="layui-upload-drag uploadView" id="@crmKyc.ControlId">
                                                                <div class="uploadShowView" id="@(crmKyc.ControlId+"View")">
                                                                    <img src="@crmKyc.Value" class="personInput" style="max-width: 100px;max-height: 100px;" id="@(crmKyc.ControlId+"Img")">
                                                                </div>
                                                            </div>
                                                            <button type="button" class="layui-btn" id="@(crmKyc.ControlId+"Upload")">点击上传</button>
                                                            <button type="button" class="layui-btn layui-btn-danger" id="@(crmKyc.ControlId+"Remove")">移除</button>
                                                        </div>
                                                    }
                                                    else
                                                    {
                                                        <div class="layui-col-lg6">
                                                            <label class="layui-form-label" lay-event="@crmKyc.Name"></label>
                                                            <div class="layui-input-block">
                                                                <input type="@crmKyc.Type" id="@crmKyc.ControlId" name="@crmKyc.Name" placeholder="@crmKyc.Name" value="@crmKyc.Value" class="layui-input">
                                                            </div>
                                                        </div>
                                                    }
                                                }
                                            }
                                        }
                                    </div>
                                    <div class="layui-input-block">
                                        <button class="layui-btn" id="personalInfoEdit" lay-event="edit" lay-submit lay-filter="personalInfoEdit">编辑</button>
                                        <button class="layui-btn layui-hide" id="personalInfoConfirmBtn" lay-event="confirmBtn" lay-submit lay-filter="personalInfoConfirmBtn">确认</button>
                                        <button class="layui-btn layui-btn-primary layui-hide" id="personalInfoCancel" lay-event="cancel" lay-submit lay-filter="personalInfoCancel">取消</button>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-tab-item">
                                <div class="layui-form">
                                    <div id="financialInformation" class="layui-row layui-col-space10 layui-form-item financialInformation">
                                        @if (ViewBag.financialInformations != null)
                                        {
                                            List<AntUnion.FrameWork.Model.Models.CrmKyc> financialInformations = ViewBag.financialInformations as List<AntUnion.FrameWork.Model.Models.CrmKyc>;
                                            if (financialInformations != null && financialInformations.Count > 0)
                                            {
                                                foreach (AntUnion.FrameWork.Model.Models.CrmKyc crmKyc in financialInformations)
                                                {
                                                    if (crmKyc.Type == "text")
                                                    {
                                                        <div class="layui-col-lg6">
                                                            <label class="layui-form-label" lay-event="@crmKyc.Name"></label>
                                                            @if (crmKyc.Required == 0)
                                                            {
                                                                <span class="required">*</span>
                                                            }
                                                            <div class="layui-input-block">
                                                                <input type="@crmKyc.Type" id="@crmKyc.ControlId" name="@crmKyc.Name" placeholder="@crmKyc.Name" value="@crmKyc.Value" class="layui-input">
                                                            </div>
                                                        </div>
                                                    }
                                                    else if (crmKyc.Type == "radio")
                                                    {
                                                        @if (!string.IsNullOrEmpty(crmKyc.Config))
                                                        {
                                                            <div class="layui-col-xs12">
                                                                <label class="layui-input-block" style="margin-left: 50px;" lay-event="@crmKyc.Name" id="@crmKyc.ControlId">@crmKyc.Name</label>
                                                                @if (crmKyc.Required == 0)
                                                                {
                                                                    <span style="color:red;">*</span>
                                                                }
                                                                <div class="layui-input-block">
                                                                    @foreach (AntUnion.FrameWork.Model.Models.CrmKycConfig config in JsonUtil.DeserializeJsonToList<AntUnion.FrameWork.Model.Models.CrmKycConfig>(crmKyc.Config))
                                                                    {
                                                                        <input type="radio" name="@config.name" value="@config.value" title="@config.title" @(crmKyc.Value == config.value ? "checked" : "")>
                                                                    }
                                                                </div>
                                                            </div>
                                                        }
                                                    }
                                                    else if (crmKyc.Type == "image")
                                                    {
                                                        <div class="layui-col-lg6">
                                                            <label class="layui-form-label" lay-event="@crmKyc.ControlId">@crmKyc.Name</label>
                                                            @if (crmKyc.Required == 0)
                                                            {
                                                                <span class="required">*</span>
                                                            }
                                                            <div class="layui-upload-drag uploadView" id="@crmKyc.ControlId">
                                                                <div class="uploadShowView" id="@(crmKyc.ControlId+"View")">
                                                                    <img src="@crmKyc.Value" class="personInput" style="max-width: 100px;max-height: 100px;" id="@(crmKyc.ControlId+"Img")">
                                                                </div>
                                                            </div>
                                                            <button type="button" class="layui-btn" id="@(crmKyc.ControlId+"Upload")">点击上传</button>
                                                            <button type="button" class="layui-btn layui-btn-danger" id="@(crmKyc.ControlId+"Remove")">移除</button>
                                                        </div>
                                                    }
                                                    else
                                                    {
                                                        <div class="layui-col-lg6">
                                                            <label class="layui-form-label" lay-event="@crmKyc.Name"></label>
                                                            <div class="layui-input-block">
                                                                <input type="@crmKyc.Type" id="@crmKyc.ControlId" name="@crmKyc.Name" placeholder="@crmKyc.Name" @crmKyc.Value class="layui-input">
                                                            </div>
                                                        </div>
                                                    }
                                                }
                                            }
                                        }
                                    </div>
                                    <div class="layui-input-block">
                                        <button class="layui-btn" id="financialInfoEdit" lay-event="edit" lay-submit lay-filter="financialInfoEdit">编辑</button>
                                        <button class="layui-btn layui-hide" id="financialInfoConfirmBtn" lay-event="confirmBtn" lay-submit lay-filter="financialInfoConfirmBtn">确认</button>
                                        <button class="layui-btn layui-btn-primary layui-hide" id="financialInfoCancel" lay-event="cancel" lay-submit lay-filter="financialInfoCancel">取消</button>
                                    </div>
                                </div>
                            </div>
                            @*<div class="layui-tab-item">
                                    <div class="layui-form">
                                        <div id="identityInformation" class="layui-row layui-col-space10 layui-form-item">
                                            @if (ViewBag.identityInformations != null)
                                            {
                                                List<AntUnion.FrameWork.Model.Models.InputModel> identityInformations = ViewBag.identityInformations as List<AntUnion.FrameWork.Model.Models.InputModel>;
                                                if (identityInformations != null && identityInformations.Count > 0)
                                                {
                                                    foreach (AntUnion.FrameWork.Model.Models.InputModel inputModel in identityInformations)
                                                    {
                                                        <div class="layui-col-lg6">
                                                            <label class="layui-form-label" lay-event="@inputModel.name"></label>
                                                            <div class="layui-input-block">
                                                                <input type="@inputModel.type" id="@inputModel.name" name="@inputModel.name" placeholder="@inputModel.name" value="@inputModel.value" disabled="disabled" class="layui-input">
                                                            </div>
                                                        </div>
                                                    }
                                                }
                                            }
                                        </div>
                                        <div class="layui-input-block">
                                            <button class="layui-btn" id="identityInfoEdit" lay-event="edit" lay-submit lay-filter="identityInfoEdit">编辑</button>
                                            <button class="layui-btn layui-hide" id="identityInfoConfirmBtn" lay-event="confirmBtn" lay-submit lay-filter="identityInfoConfirmBtn">确认</button>
                                            <button class="layui-btn layui-btn-primary layui-hide" id="identityInfoCancel" lay-event="cancel" lay-submit lay-filter="identityInfoCancel">取消</button>
                                        </div>
                                    </div>
                                </div>*@
                            <div class="layui-tab-item">
                                <table class="layui-hide" id="table-datalist-mt5user" lay-filter="table-datalist-mt5user"></table>
                                <script type="text/html" id="zizeng">
                                    {{d.LAY_TABLE_INDEX+1}}
                                </script>
                                <script type="text/html" id="table-datalist-bar-mt5user">
                                    <button class="layui-btn layui-btn-sm" lay-event="view">查看</button>
                                </script>
                            </div>
                            <div class="layui-tab-item">
                                <table class="layui-hide" id="table-datalist-crmWallet" lay-filter="table-datalist-crmWallet"></table>
                                <script type="text/html" id="crmWalletIndex">
                                    {{d.LAY_TABLE_INDEX+1}}
                                </script>
                                <script type="text/html" id="table-datalist-bar-crmWallet">
                                    <button class="layui-btn layui-btn-sm" lay-event="view">查看</button>
                                </script>
                            </div>
                            <div class="layui-tab-item">
                                <div class="layui-table-tool layui-form" style="box-sizing: border-box;">
                                    <div class="layui-table-tool-temp">
                                        <button type="button" class="layui-btn layui-btn-sm layui-btn-normal" id="electronicAccount" lay-submit lay-filter="electronicAccount">电子账户</button>
                                        <button type="button" class="layui-btn layui-btn-sm layui-btn-normal" id="bankAccount" lay-submit lay-filter="bankAccount">银行账户</button>
                                        <button type="button" class="layui-btn layui-btn-sm layui-btn-normal" id="cryptocurrency" lay-submit lay-filter="cryptocurrency">加密货币</button>
                                    </div>
                                </div>
                                <script type="text/html" id="collectionAccountIndex">
                                    {{d.LAY_TABLE_INDEX+1}}
                                </script>
                                <table class="layui-hide" id="table-datalist-collectionAccount" lay-filter="table-datalist-collectionAccount"></table>
                                <div id="divShowQrcode" style='overflow:auto;display:flex;align-items:center;justify-content:center;max-width: 100%;max-height: 100%'>
                                    <div id='showqrcode' style='max-width: 100%;max-height: 100%;position: absolute;top: 50%;transform: translateY(-50%);'></div>
                                </div>
                            </div>
                            <div class="layui-tab-item">
                                <div class="layui-row layui-col-space10">
                                    <div class="layui-form">
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" lay-event="returningRole">返佣角色</label>
                                                <div class="layui-input-inline">
                                                    <select name="returningRole" id="returningRole" disabled>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" lay-event="programme">返佣方案</label>
                                                <div class="layui-input-inline">
                                                    <select name="programme" id="programme" disabled>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-input-block">
                                        <button class="layui-btn" id="programmeEdit" lay-event="edit" lay-submit lay-filter="programmeEdit">编辑</button>
                                        <button class="layui-btn layui-hide" id="programmeConfirmBtn" lay-event="confirmBtn" lay-submit lay-filter="programmeConfirmBtn">确认</button>
                                        <button class="layui-btn layui-btn-primary layui-hide" id="programmeCancel" lay-event="cancel" lay-submit lay-filter="programmeCancel">取消</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

